from datetime import datetime
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import Column, Integer, String, Text, DateTime  # 添加这行导入

db = SQLAlchemy()

class Data(db.Model):
    __tablename__ = 'data'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)    # 必须字段
    yuanbao = db.Column(db.String(20), nullable=True)  # 改为字符串且可为空
    jinbi = db.Column(db.String(20), nullable=True)    # 改为字符串且可为空
    beizhu = db.Column(db.Text, nullable=True)         # 可为空
    jointime = db.Column(db.DateTime, default=datetime.now)